//
//  UIScreen+additions.m
//  Tool
//
//  Created by ZJ on 17/2/15.
//  Copyright © 2017年 ZJ. All rights reserved.
//

#import "UIScreen+additions.h"

@implementation UIScreen (additions)

+ (BOOL)isIPhoneXSeries{
    BOOL iPhoneXSeries = NO;
    if (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPhone) {
        return iPhoneXSeries;
    }
    
    if (@available(iOS 11.0, *)) {
        UIWindow *mainWindow = [[[UIApplication sharedApplication] delegate] window];
        if (mainWindow.safeAreaInsets.bottom > 0.0) {
            iPhoneXSeries = YES;
        }
    }
    
    return iPhoneXSeries;
}
+ (CGFloat)zj_screenWith{
    
    return [UIScreen mainScreen].bounds.size.width;
}

+ (CGFloat)zj_screenHeight{
    return [UIScreen mainScreen].bounds.size.height;
}

+ (CGFloat)zj_textFontScale{
    return [UIScreen mainScreen].bounds.size.width / 375.0;
}

+ (CGFloat)zj_screenWScale{
    return [UIScreen mainScreen].bounds.size.width / 375.0;
}
+ (CGFloat)zj_screenHScale{
    return [UIScreen zj_screenWScale];
}
@end
